<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--  react核心库  -->
    <script src="lib/react.development.js"></script>
    <!--  reactdom:操作DOM  -->
    <script src="lib/react-dom.development.js"></script>
    <script src="lib/babel.min.js"></script>
    <style>
        .active {
            background-color: red;
            width: 200px;
            height: 200px;
        }
    </style>
</head>
<body>
<!--指定挂载的位置-->
<div id="root"></div>
</body>
<script type="text/babel">
    // 创建一个React容器
    const root = ReactDOM.createRoot(document.querySelector("#root"));

    // 1.通过样式来控制显示隐藏
    class App extends React.Component {
        state = {
            isshow: true
        }
        render() {
            return (
                <div>
                    <button onClick={() => {
                        setState({
                            is
                        })
                    }}>显示与隐藏</button>
                    <div className="active"></div>
                </div>
            )
        }
    }
    // 指定挂载内容
    root.render(<App/>);
</script>
</html>